#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int ans = 0;
	while(a--)
	{
		ans++;
		if(ans%b==0) a++;
	}
	cout<<ans<<endl;
}
